﻿#region RDIFramework.NET-generated
//------------------------------------------------------------------------------
//	RDIFramework.NET（.NET快速信息化系统开发、整合框架）是基于.NET的快速信息化系统开发、整合框架，给用户和开发者最佳的.Net框架部署方案。
//	RDIFramework.NET平台包含基础公共类库、强大的权限控制、模块分配、数据字典、自动升级、各商业级控件库、工作流平台、代码生成器、开发辅助
//工具等，应用系统的各个业务功能子系统，在系统体系结构设计的过程中被设计成各个原子功能模块，各个子功能模块按照业务功能组织成单独的程序集文
//件，各子系统开发完成后，由RDIFramework.NET平台进行统一的集成部署。
//
// 官方博客：http://www.cnblogs.com/huyong
//           http://blog.csdn.net/chinahuyong
//    Email：80368704@qq.com
//       QQ：80368704
//------------------------------------------------------------------------------
// <auto-generated>
//	此代码由RDIFramework.NET平台代码生成工具自动生成。
//	运行时版本:4.0.30319.1
//
//	对此文件的更改可能会导致不正确的行为，并且如果
//	重新生成代码，这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
#endregion

using System;
using System.Collections.Generic;
using System.Data;

namespace Centaline.BizLogic
{
    using RDIFramework.Utilities;

    /// <summary>
    /// RepairsEntity
    /// 
    /// 
    /// 修改纪录
    /// 
    /// 2014-04-02 版本：1.0  创建主键。
    /// 
    /// 版本：1.0
    /// 
    /// <author>
    /// <name></name>
    /// <date>2014-04-02</date>
    /// </author>
    /// </summary>
    [Serializable]
    public partial class RepairsEntity 
    {
        private int? id = null;
        /// <summary>
        /// Id
        /// </summary>
        public int? Id
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        private String workOrderId = string.Empty;
        /// <summary>
        /// 工单号
        /// </summary>
        public String WorkOrderId
        {
            get
            {
                return this.workOrderId;
            }
            set
            {
                this.workOrderId = value;
            }
        }

        private String computerNumber = string.Empty;
        /// <summary>
        /// 电脑编号
        /// </summary>
        public String ComputerNumber
        {
            get
            {
                return this.computerNumber;
            }
            set
            {
                this.computerNumber = value;
            }
        }

        private int? articleId = null;
        /// <summary>
        /// 物品id
        /// </summary>
        public int? ArticleId
        {
            get
            {
                return this.articleId;
            }
            set
            {
                this.articleId = value;
            }
        }

        private int? mtStaff = null;
        /// <summary>
        /// 维修人员id
        /// </summary>
        public int? MtStaff
        {
            get
            {
                return this.mtStaff;
            }
            set
            {
                this.mtStaff = value;
            }
        }

        private DateTime? finishMtTime = null;
        /// <summary>
        /// 维修完成时间
        /// </summary>
        public DateTime? FinishMtTime
        {
            get
            {
                return this.finishMtTime;
            }
            set
            {
                this.finishMtTime = value;
            }
        }

        private DateTime? applyMtTime = null;
        /// <summary>
        /// 提交报修时间
        /// </summary>
        public DateTime? ApplyMtTime
        {
            get
            {
                return this.applyMtTime;
            }
            set
            {
                this.applyMtTime = value;
            }
        }

        private int? statusId = null;
        /// <summary>
        /// 当前维修状态id
        /// </summary>
        public int? StatusId
        {
            get
            {
                return this.statusId;
            }
            set
            {
                this.statusId = value;
            }
        }

        private String mtAddress = string.Empty;
        /// <summary>
        /// 故障设备地址
        /// </summary>
        public String MtAddress
        {
            get
            {
                return this.mtAddress;
            }
            set
            {
                this.mtAddress = value;
            }
        }

        private int? applyMtStaffid = null;
        /// <summary>
        /// 提交报修人员id
        /// </summary>
        public int? ApplyMtStaffid
        {
            get
            {
                return this.applyMtStaffid;
            }
            set
            {
                this.applyMtStaffid = value;
            }
        }

        private String email = string.Empty;
        /// <summary>
        /// Email
        /// </summary>
        public String Email
        {
            get
            {
                return this.email;
            }
            set
            {
                this.email = value;
            }
        }

        private String phone = string.Empty;
        /// <summary>
        /// Phone
        /// </summary>
        public String Phone
        {
            get
            {
                return this.phone;
            }
            set
            {
                this.phone = value;
            }
        }

        private int? whoArrange = null;
        /// <summary>
        /// 安排维修者的id
        /// </summary>
        public int? WhoArrange
        {
            get
            {
                return this.whoArrange;
            }
            set
            {
                this.whoArrange = value;
            }
        }

        private int? rate = null;
        /// <summary>
        /// 评分
        /// </summary>
        public int? Rate
        {
            get
            {
                return this.rate;
            }
            set
            {
                this.rate = value;
            }
        }

        private String evaluat = string.Empty;
        /// <summary>
        /// 评价内容
        /// </summary>
        public String Evaluat
        {
            get
            {
                return this.evaluat;
            }
            set
            {
                this.evaluat = value;
            }
        }

        private String reason = string.Empty;
        /// <summary>
        /// Reason
        /// </summary>
        public String Reason
        {
            get
            {
                return this.reason;
            }
            set
            {
                this.reason = value;
            }
        }

        private int? deleteMark = null;
        /// <summary>
        /// DeleteMark
        /// </summary>
        public int? DeleteMark
        {
            get
            {
                return this.deleteMark;
            }
            set
            {
                this.deleteMark = value;
            }
        }

        private int? sortCode = null;
        /// <summary>
        /// SortCode
        /// </summary>
        public int? SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        private String description = string.Empty;
        /// <summary>
        /// Description
        /// </summary>
        public String Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        private DateTime? createOn = null;
        /// <summary>
        /// CreateOn
        /// </summary>
        public DateTime? CreateOn
        {
            get
            {
                return this.createOn;
            }
            set
            {
                this.createOn = value;
            }
        }

        private String createUserId = string.Empty;
        /// <summary>
        /// CreateUserId
        /// </summary>
        public String CreateUserId
        {
            get
            {
                return this.createUserId;
            }
            set
            {
                this.createUserId = value;
            }
        }

        private String createBy = string.Empty;
        /// <summary>
        /// CreateBy
        /// </summary>
        public String CreateBy
        {
            get
            {
                return this.createBy;
            }
            set
            {
                this.createBy = value;
            }
        }

        private DateTime? modifiedOn = null;
        /// <summary>
        /// ModifiedOn
        /// </summary>
        public DateTime? ModifiedOn
        {
            get
            {
                return this.modifiedOn;
            }
            set
            {
                this.modifiedOn = value;
            }
        }

        private String modifyUserId = string.Empty;
        /// <summary>
        /// ModifyUserId
        /// </summary>
        public String ModifyUserId
        {
            get
            {
                return this.modifyUserId;
            }
            set
            {
                this.modifyUserId = value;
            }
        }

        private String modifiedBy = string.Empty;
        /// <summary>
        /// ModifiedBy
        /// </summary>
        public String ModifiedBy
        {
            get
            {
                return this.modifiedBy;
            }
            set
            {
                this.modifiedBy = value;
            }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public RepairsEntity()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public RepairsEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public RepairsEntity(IDataReader dataReader)
        {
            this.GetFrom(dataReader);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public RepairsEntity(DataTable dataTable)
        {
            this.GetSingle(dataTable);
        }

        /// <summary>
        /// 从数据表读取
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public RepairsEntity GetSingle(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow dataRow in dataTable.Rows)
            {
                this.GetFrom(dataRow);
                break;
            }
            return this;
        }

        /// <summary>
        /// 从数据表读取返回实体列表
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public List<RepairsEntity>  GetList(DataTable dataTable)
        {
            List<RepairsEntity> entities=new List<RepairsEntity>();
            foreach(DataRow dataRow in dataTable.Rows)
            {
                entities.Add(GetFrom(dataRow));
            }
            return entities;
        }

        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public RepairsEntity GetFrom(DataRow dataRow)
        {
            this.Id = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldId]);
            this.WorkOrderId = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldWorkOrderId]);
            this.ComputerNumber = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldComputerNumber]);
            this.ArticleId = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldArticleId]);
            this.MtStaff = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldMtStaff]);
            this.FinishMtTime = BusinessLogic.ConvertToDateTime(dataRow[RepairsTable.FieldFinishMtTime]);
            this.ApplyMtTime = BusinessLogic.ConvertToDateTime(dataRow[RepairsTable.FieldApplyMtTime]);
            this.StatusId = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldStatusId]);
            this.MtAddress = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldMtAddress]);
            this.ApplyMtStaffid = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldApplyMtStaffid]);
            this.Email = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldEmail]);
            this.Phone = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldPhone]);
            this.WhoArrange = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldWhoArrange]);
            this.Rate = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldRate]);
            this.Evaluat = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldEvaluat]);
            this.Reason = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldReason]);
            this.DeleteMark = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldDeleteMark]);
            this.SortCode = BusinessLogic.ConvertToInt(dataRow[RepairsTable.FieldSortCode]);
            this.Description = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldDescription]);
            this.CreateOn = BusinessLogic.ConvertToDateTime(dataRow[RepairsTable.FieldCreateOn]);
            this.CreateUserId = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldCreateUserId]);
            this.CreateBy = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldCreateBy]);
            this.ModifiedOn = BusinessLogic.ConvertToDateTime(dataRow[RepairsTable.FieldModifiedOn]);
            this.ModifyUserId = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldModifyUserId]);
            this.ModifiedBy = BusinessLogic.ConvertToString(dataRow[RepairsTable.FieldModifiedBy]);
            return this;
        }

        /// <summary>
        /// 从数据流读取
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public RepairsEntity GetFrom(IDataReader dataReader)
        {
            this.Id = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldId]);
            this.WorkOrderId = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldWorkOrderId]);
            this.ComputerNumber = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldComputerNumber]);
            this.ArticleId = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldArticleId]);
            this.MtStaff = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldMtStaff]);
            this.FinishMtTime = BusinessLogic.ConvertToDateTime(dataReader[RepairsTable.FieldFinishMtTime]);
            this.ApplyMtTime = BusinessLogic.ConvertToDateTime(dataReader[RepairsTable.FieldApplyMtTime]);
            this.StatusId = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldStatusId]);
            this.MtAddress = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldMtAddress]);
            this.ApplyMtStaffid = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldApplyMtStaffid]);
            this.Email = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldEmail]);
            this.Phone = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldPhone]);
            this.WhoArrange = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldWhoArrange]);
            this.Rate = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldRate]);
            this.Evaluat = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldEvaluat]);
            this.Reason = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldReason]);
            this.DeleteMark = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldDeleteMark]);
            this.SortCode = BusinessLogic.ConvertToInt(dataReader[RepairsTable.FieldSortCode]);
            this.Description = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldDescription]);
            this.CreateOn = BusinessLogic.ConvertToDateTime(dataReader[RepairsTable.FieldCreateOn]);
            this.CreateUserId = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldCreateUserId]);
            this.CreateBy = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldCreateBy]);
            this.ModifiedOn = BusinessLogic.ConvertToDateTime(dataReader[RepairsTable.FieldModifiedOn]);
            this.ModifyUserId = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldModifyUserId]);
            this.ModifiedBy = BusinessLogic.ConvertToString(dataReader[RepairsTable.FieldModifiedBy]);
            return this;
        }
    }
}
